<?php
require_once('ngdom.functions.php');
ngdom_set_game(empty($_POST['game']) ? 'default' : $_POST['game']);
switch($_POST['action']) {
	case 'save':
		exit(ngdom_save_game());
		break;
	case 'delete':
		exit(ngdom_delete_game());
		break;
	case 'createaccount':
		exit(ngdom_create_account());
		break;
	case 'login':
		exit(ngdom_user_login());
		break;
	case 'resetpassword':
		exit(ngdom_reset_password());
		break;
	case 'changepassword':
		exit(ngdom_change_password());
		break;
}
?>